import {Filter} from "./Filter";
import {Feature} from "@turf/helpers";

export class MultiFilter implements Filter {

    protected filters: Array<Filter> = [];

    constructor(filters: Array<Filter>) {
        this.filters = filters;
    }

    filter(feature: Feature): boolean {
        let isFilter = true;

        for (let filter of this.filters) {
            isFilter = filter.filter(feature) && isFilter;
        }

        return isFilter;
    }
}
